﻿using System.Data.Entity.ModelConfiguration;
using eCommerce.Core.Domain.ShoppingCarts;

namespace eCommerce.Data.Mapping.ShoppingCarts
{
    public class ShoppingCartItemMapping: EntityTypeConfiguration<ShoppingCartItem>
    {
        public ShoppingCartItemMapping()
        {
            this.ToTable("ShoppingCartItems");
            this.HasKey(sci => sci.Id);

        

            this.HasRequired(sci => sci.Customer)
                .WithMany(c => c.ShoppingCartItems)
                .HasForeignKey(sci => sci.CustomerId);

            //this.HasRequired(sci => sci.ProductVariant)
            //    .WithMany()
            //    .HasForeignKey(sci => sci.ProductVariantId);
        }
    }
}